Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pezzo OpenAI reporting (with and without prompt management) #147

Merged
merged 13 commits into from
Jul 31, 2023

Conversation

arielweinberger
Copy link
Member

Features

PezzoOpenAI Class

A new class named "PezzoOpenAI" used to execute OpenAI chat completion requests. Mirroring the native OpenAI.createChatCompletion method (plus a 2nd argument for variables and custom properties).

Usage example - with prompt management

Assuming the Pezzo client has been initiated:

const prompt = await pezzo.getPrompt("GenerateTasks");

const result = await openai.createChatCompletion(prompt, {
  variables: {
    goal,
    numTasks,
  },
  properties: {
    traceId: "SomeTraceId123",
  },
});

Usage without prompt management

const result = await openai.createChatCompletion({
  model: "gpt-3.5-turbo",
  messages: []
}, {
  variables: {
    goal,
    numTasks,
  },
  properties: {
    traceId: "SomeTraceId123",
  },
});

Paginated Requests Table

image

Filters

Basic filtering is in place. Still need to be extended to support custom properties, date picking etcetera.
image

"Unmanaged Prompt Warning"

If requests are reported but prompts are not managed by Pezzo, a warning will be displayed, with a tooltip on hover. In the future we will allow auto-importing of prompts.
image

Request Inspector

image

@arielweinberger arielweinberger marked this pull request as ready for review July 29, 2023 13:55
@nx-cloud
Copy link

nx-cloud bot commented Jul 29, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c93f568. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

Copy link
Contributor

@eylonmiz eylonmiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arielweinberger arielweinberger merged commit 53cb09e into release/0.4.0 Jul 31, 2023
3 checks passed
@arielweinberger arielweinberger deleted the feature/reporting-pezzo-openai-client branch July 31, 2023 08:09
@arielweinberger arielweinberger restored the feature/reporting-pezzo-openai-client branch July 31, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants